<?php
 
class TextHelper {
    
    public static function escape($input) {
        $output = $input;
        
        $output = strip_tags($output);
        $output = str_replace("\"", "&quot;", $output);
        $output = str_replace(PHP_EOL, "", $output);
        
        $output = trim($output);
        
        return $output;
    }
    
    public static function unescape($input) {
        $output = $input;
        
        $output = html_entity_decode($output);
        
        $output = trim($output);
        
        return $output;
    }
    
}